local skel = fk.CreateSkill{
  name = "tea__andong",
}
Fk:loadTranslationTable{
  ["tea__andong"] = "安东",
  [":tea__andong"] = "出牌阶段/当你受到伤害后，你可以展示手牌，重铸其中所有的【杀】/【闪】并摸一张牌/回复1点体力，令一名其他角色/伤害来源展示手牌，并重铸所有的【闪】/【杀】。",
  ["#tea__andong-choose"] = "安东：选择一名其他角色，其展示手牌并重铸所有【闪】",
  ["tea__andong_tip"] = "重铸闪"
}
---@type ActiveSkillSpec
local andong_active = {
  mute = true,
  card_filter = Util.FalseFunc,
  target_filter = Util.FalseFunc,
  can_use = function (self, player)
    return table.find(player:getCardIds("h"), function(id)
      return Fk:getCardById(id).trueName == "slash"
    end)
  end,
  on_use = function (self, room, skillUseEvent)
    local player = skillUseEvent.from
    player:broadcastSkillInvoke(skel.name, table.random{1, 2})
    room:notifySkillInvoked(player, skel.name, "drawcard")
    player:showCards(player:getCardIds("h"))
    if not player.dead then
      local cards = table.filter(player:getCardIds("h"), function(id)
        return Fk:getCardById(id).trueName == "slash"
      end)
      room:recastCard(cards, player, skel.name)
      if not player.dead then
        player:drawCards(1, skel.name)
        if not player.dead then
          local targets = table.filter(room:getAlivePlayers(), function(p)
            return p ~= player and not p:isKongcheng()
          end)
          if #targets > 0 then
            local to = room:askToChoosePlayers(player, {
              targets = targets,
              target_tip_name = skel.name,
              skill_name = skel.name,
              prompt = "#tea__andong-choose",
              min_num = 1,
              max_num = 1,
              cancelable = false
            })
            if #to == 1 then
              to = to[1]
              room:doIndicate(player, {to})
              to:showCards(to:getCardIds("h"))
              if not to.dead then
                local cards2 = table.filter(to:getCardIds("h"), function(id)
                  return Fk:getCardById(id).trueName == "jink"
                end)
                if #cards2 > 0 then
                  room:recastCard(cards2, to, skel.name)
                end
              end
            end
          end
        end
      end
    end
  end
}
---@type TrigSkelSpec<DamageTrigFunc>
local andong = {
  mute = true,
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and not player:isKongcheng()
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke(skel.name, table.random{3, 4})
    room:notifySkillInvoked(player, skel.name, "drawcard")
    player:showCards(player:getCardIds("h"))
    if not player.dead then
      local cards = table.filter(player:getCardIds("h"), function(id)
        return Fk:getCardById(id).trueName == "jink"
      end)
      if #cards > 0 then
        room:recastCard(cards, player, skel.name)
        if not player.dead and player:isWounded() then
          room:recover{
            who = player,
            skillName = skel.name,
            num = 1
          }
        end
      end
    end
    room:delay(600)
    if data.from and not data.from.dead and not data.from:isKongcheng() then
      room:doIndicate(player, {data.from})
      data.from:showCards(data.from:getCardIds("h"))
      if not data.from.dead then
        local cards = table.filter(data.from:getCardIds("h"), function(id)
          return Fk:getCardById(id).trueName == "slash"
        end)
        if #cards > 0 then
          room:recastCard(cards, data.from, skel.name)
        end
      end
    end
  end
}
Fk:addTargetTip{
  name = skel.name,
  target_tip = function (self, player, to_select, selected, selected_cards, card, selectable, extra_data)
    if table.contains(selected, to_select) then
      return "tea__andong_tip"
    end
    return
  end,
}
skel:addEffect("active", andong_active)
skel:addEffect(fk.Damaged, andong)
return skel